    (function($){
        $.searitem=
        {
            items:function()
            {
              var action=arguments[0];//操作 
              var defaultaction=$("input[name='action']").val();

              var page=(action==defaultaction)?$("input[name='nextpage']").val():1;
              var keywords=$("input[name='keywords']").val();
              var total=$("input[name='pagetotal']").val();
              var brandid=$("input[name='brandid']").val();
              var typeid=$("input[name='typeid']").val();
              total=Number(total);
              page=Number(page);
              if(page>=total) { $('.btn-more').html('已经最后一页了'); return false;} //请求的页数大于总页数
              $.ajax({
                type:'POST',
                url:"/vshop.php/Home/Lists/Search",
                data:{"page":page,"brandid":brandid,"typeid":typeid,"keywords":keywords},
                dataType:'json',
                success:function(result)
                {
                  if(result.status==false)
                  {
                    $(".pro-list").html("暂无数据");
                    $(".btn-more").hide();
                    return false;
                  }
                  var items=result.item;
                  var pagearr=result.pagearr;
                  var $string='';
                  $.each(items,function(key,items)
                  {
                    $string+="<dl>";
                    $string+="<dt><a href=/vshop.php/Home/ItemDetail/index/itemid/"+items.itemid+"><img src=http://api.szl66.com"+items.itemimg+"></a></dt>";
                    $string+="<dd>";
                    $string+=" <p class='tit'>"+items.itemname+"</p>";
                    $string+='<p class="tip"><em class="orange">'+items.bn+"</em></p>";
                     $string+= '<p class="red f16"><strong>￥'+items.price+'</strong></p>';
                    $string+="</dd>";
                    $string+="</dl>";
                  })
                  if(action=='search'){ $('.pro-list').children().remove(""); }
                  $('.pro-list').append($string);
                  $("input[name='nextpage']").val(pagearr.nextpage);
                  $("input[name='pagetotal']").val(pagearr.pagetotal);
                  $("input[name='action']").val(action);
               }
               })

          },
    }
    })(jQuery);
     

